function converToCastString(casts) {
  let castsjoin = "";
  for (let i in casts) {
    castsjoin += casts[i].name + "/"
  }
  return castsjoin.substring(0, castsjoin.length - 2)
}

function convertToCastInfos(casts) {
  let castsArray = [];
  for (let i in casts) {
    const cast = {
      img: casts[i].avatars ? casts[i].avatars.large : "",
      name: casts[i].name
    }
    castsArray.push(cast)
  }
  return castsArray
}

export {
  converToCastString,
  convertToCastInfos
}